<template>
	<view>
		<view class="head-top">
			<i  @click="back('/pages/personal/index')"  class="hd-icon back">&#xe646;</i>
			<view class="search-container" v-if="is_search">
				<input type="text" v-model="keywords"  placeholder="请输入关键词" value=""/>
				<view  @click="Search"><i class="hd-icon">&#xe70a;</i></view>
			</view>
			<p  v-if="!is_search">{{title}}</p>
			<view class="head-right">
				<i @click="go('/pages/personal/index')" class="hd-icon">&#xe651;</i>
				<i @click="navigateCart()" class="hd-icon">&#xe600;</i>
			</view> 
		</view> 
	</view>
</template>

<script>
	export default{
		data(){
			return{
				keywords:''
			}
		},
		props:['is_search','title'],
		methods:{
			go(url){
				uni.navigateTo({
				    url: url
				});
			},
			Search(){
				this.$emit('sendSearch',this.keywords)
			},
			back(){
				uni.navigateBack({
				    delta: 1
				});
			},
			navigateCart(){
				this.$Shop.navigateCart();
			}
		}
	}
</script>

<style lang="scss" scoped>
	.head-right{
		display: flex;
		i{
			float: right;
			font-size:46rpx;
			margin-right:20rpx;
			color:#fd8197;
		}
	}
	.back{
		font-size:46rpx;
		margin-left:20rpx;
		color:#fd8197;
	}
	.head-top{
		background: #fff;
		width:100%;
		display: flex;
		justify-content:space-between;
		position:fixed;
		align-items: center;
		top:0;
		left:0;
		z-index: 999;
		padding:20rpx 0;
		border-bottom:1px solid #d1d1d1;
		.search-container{
			display: flex;
			justify-content:space-between;
			width:480rpx;
			height: 60rpx;
			line-height: 60rpx;
			border:1rpx solid #eee;
			margin-right:12.5rpx;
			border-radius:8rpx;
			input{
				height: 100%;
				padding:0 20rpx;
				font-size:23rpx;
			}
			view{
				color: #fc5f99;
				width: 60rpx;
				display: block;
				text-align: center;
				i{
					font-size: 40rpx;
				}
			}
		}
		.logo{
			width:144rpx;
			height: 0;
		}
		.logo-desc{
			width:125rpx;
			margin-right:12.5rpx;
		}
	}
</style>
